1. Field of the Invention
The present disclosure generally relates to a method and a device for image processing. In particular, the present disclosure relates to a method and a device for detecting glare pixels of an image.
2. Description of Related Art
As a digital camera has become small, compact, and inexpensive, consequently, the digital camera could be embedded in handheld electronic devices such as cellular phones, smart phones, tablet computers, personal digital assistants (PDA) and so forth. The diminutive nature of such camera allows the camera to become a convenient and popular additional feature of portable consumer electronic devices. However, the portability of such electronic devices may have prevented many more sophisticated uses or structures to be included for such cameras. For example, fixed focal length lenses and small sensors would typically be used for such cameras since an optical zoom lens may be too heavy and require more physical depths than the body of the handheld electronic device would permit.
Presently, as such cameras are frequently used to take facial portraits in various events or gatherings, problems associated with light-related artifacts on the images could be unavoidable. Such artifacts may not be immediately noticeable and the impacts on the quality of an image may not be appreciated after an image is taken. A typical artifact encountered by the user may include glare. In photography, glare could be characterized as an occurrence of a harsh bright light which causes a regional overexposure on an image. Glare may occur because of reasons such as bright environment, rapid transitions to different luminance adaptation levels, a direct light source, or reflections from objects with glass or metal surfaces. One of the most common causes of glare is the light from a photographic flash. Getting the best overall exposure from the combination of available light and flash illumination may pose a significant technical challenge, especially for the camera built-in to handheld electronic devices. One of the typical solutions could be to manually retouch or to modify images by using various software applications for assistance. Unfortunately, this practice may be time intensive and cumbersome especially in the case of a large amount of images. Also, the practice may produce unsatisfactory results if the users are not skillful in the use of image retouch or modification software.
Another solution is to leverage machine learning algorithms to automatically detect an artifact on a facial portrait image. Most analyses involving image recognition and classification are statistical in nature. Images could be classified based on information extracted from datasets. Automated classification may assign image pixels to real-world objects or classes. Image classification would traditionally be based on the allocation of individual pixels to the most suitable class. A most common approach to perform classification is probabilistic classification. The algorithms of this nature such as Bayesian networks, Hidden Markov Models (HMM), neural networks, decision trees, linear discriminant analysis (LDA) use statistical inference to find the best class for a given instance. On the other hand, although such algorithms have high detection rate on the artifact, they would highly depend on training data and model parameters as well as performance resource, power and time consuming arithmetic operations, which may be impractical for relatively inexpensive and memory-limited handheld electronic devices. Accordingly, there could be a demand to develop tools to improve the probability of successful detections and to reduce the probability of false alarms while ensuring optimal performance executed by electronic devices with limited computational resources.